import request from './apiConfig.js'
const base_url = "/a/o"
/**
 * 获取验证码
 */
export function getCaptchaApi() {
    return request({
        url: base_url + "/captcha",
        method: 'GET'
    })
}
/**
 * 登录
 */
export function loginApi(user) {
    return request({
        url: base_url + "/login",
        method: 'POST',
        data: user
    })
}

/**
 * 根据token获取用户信息，实现自动登录
 */
export function getUserByTokenApi() {
    return request({
        url: base_url + '/token',
        method: 'GET'
    })
}

/**
 * 登出
 */
export function logoutApi() {
    return request({
        url: base_url + "/logout",
        method: "GET"
    })
}